package com.russell.pms.model;

import java.io.Serializable;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.russell.util.DateUtil;

/**
 * The Class BaseObject.
 * 
 * @author <a href="mailto:fvinluan@gmail.com">Francis Vinluan</a>
 * @version $Revision: 1.0 $
 */
public abstract class BaseObject implements Serializable {

	private static final long serialVersionUID = -7005794759447306717L;

	private String createdBy;
	private Date dateCreated;
	private Date dateModified;
	protected transient final Logger logger = LoggerFactory
			.getLogger(getClass());
	private String modifiedBy;

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public abstract boolean equals(Object o);

	/**
	 * Gets the created by.
	 * 
	 * 
	 * 
	 * @return the createdBy
	 */
	public String getCreatedBy() {
		return createdBy;
	}

	/**
	 * Gets the date created.
	 * 
	 * 
	 * 
	 * @return the dateCreated
	 */
	public Date getDateCreated() {
		return DateUtil.copyDate(dateCreated);
	}

	/**
	 * Gets the date modified.
	 * 
	 * 
	 * 
	 * @return the dateModified
	 */
	public Date getDateModified() {
		return DateUtil.copyDate(dateModified);
	}

	/**
	 * Gets the modified by.
	 * 
	 * 
	 * 
	 * @return the modifiedBy
	 */
	public String getModifiedBy() {
		return modifiedBy;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public abstract int hashCode();

	/**
	 * Sets the created by.
	 * 
	 * @param createdBy
	 *            the createdBy to set
	 */
	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	/**
	 * Sets the date created.
	 * 
	 * @param dateCreated
	 *            the dateCreated to set
	 */
	public void setDateCreated(Date dateCreated) {
		this.dateCreated = DateUtil.copyDate(dateCreated);
	}

	/**
	 * Sets the date modified.
	 * 
	 * @param dateModified
	 *            the dateModified to set
	 */
	public void setDateModified(Date dateModified) {
		this.dateModified = DateUtil.copyDate(dateModified);
	}

	/**
	 * Sets the modified by.
	 * 
	 * @param modifiedBy
	 *            the modifiedBy to set
	 */
	public void setModifiedBy(String modifiedBy) {
		this.modifiedBy = modifiedBy;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public abstract String toString();

}
